﻿<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="MailBoxDetails.aspx.cs" Inherits="Trade_Inbox_MailBoxDetails" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>邮件细节</title>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadEditor), "Telerik.Web.UI.Skins.Editor.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(Telerik.Web.UI.RadEditor), "Telerik.Web.UI.Skins.Outlook.Editor.Outlook.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(RadWindow), "Telerik.Web.UI.Skins.Window.css") %>'
            rel="stylesheet" type="text/css" />
        <link href='<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, typeof(Telerik.Web.UI.RadWindow), "Telerik.Web.UI.Skins.Outlook.Window.Outlook.css") %>'
            rel="stylesheet" type="text/css" />
    </telerik:RadCodeBlock>
    <style type="text/css">
        form, body, html
        {
            padding: 0;
            margin: 0;
            overflow: hidden;
            background-color: white;
            font: normal 13px "Segoe UI" , Arial, Verdana;
            color: black;
        }
        
        .reply_box
        {
            border: solid 1px #666;
        }
        
        .reply_box[disabled]
        {
            border: 0;
            background-color: white;
        }
        
        .mailBtn
        {
            padding: 0;
            margin: 4px 0 0 0;
            list-style: none;
            float: right;
        }
        
        .mailBtn li
        {
            float: left;
        }
        
        .mailBtn li a
        {
            display: block;
            border: solid 1px black;
            background: maroon;
            width: 100px;
            line-height: 22px;
            color: white;
            text-decoration: none;
            font-weight: bold;
            font-size: 11px;
            margin: 0 0 0 2px;
        }
        
        .mailBtn li a:hover
        {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog 
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well) 

            return oWindow;
        }
        function CloseWnd() {
            GetRadWindow().close();
        }
    </script>
         
        
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadSkinManager ID="RadSkinManager" runat="server" Skin="Outlook">
    </telerik:RadSkinManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />

    <asp:SqlDataSource ID="sdsViewDetail" runat="server" 
        ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>" 
        SelectCommand="select N.CreateUserID ,N.Title,N.SendDate,N.Status,N.BodyText,U.UserName,N.ReplyDate,N.Attachment
        from [XunPan].[dbo].[XPNotification] N,[XunPan].[dbo].[aspnet_Users] U
        where N.CreateUserID = U.UserId  and N.NotifyID = @NotifyID 
        order by N.CreateDate desc">
        <SelectParameters>
            <asp:Parameter Name="NotifyID" DbType="Guid" />
        </SelectParameters>

    </asp:SqlDataSource>

    <telerik:RadAjaxPanel OnAjaxRequest="Button1_Click" ID="RadAjaxPanel1" runat="server"
        LoadingPanelID="RadLoadingPanel1">
 <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" Width="119%"
 CellPadding="0" Height="100%" GridLines="None" DataSourceID="sdsViewDetail">
            <Fields >
                <asp:BoundField DataField="UserName" HeaderText="发件人" HeaderStyle-Width="150" SortExpression="UserName" />
                <asp:BoundField DataField="SendDate" DataFormatString="{0:yyyy/MM/dd}" HeaderText="发送时间" SortExpression="SendDate" />
                <asp:TemplateField HeaderText="邮件处理状态">
                    <ItemTemplate>
                         <asp:TextBox ID="tStatus" runat="server" Width="100%" CssClass="reply_box" Enabled="false"
                         Text='<%#Eval("Status").ToString().EndsWith("1") ? "于" + String.Format("{0:G}", Eval("SendDate")) + "已回复邮件"+ Eval("Title").ToString().Substring(4): "尚未回复邮件" %>'></asp:TextBox>
                         
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="主题">
                    <ItemTemplate>
                         <asp:TextBox ID="tbTitle" runat="server" CssClass="reply_box" Enabled="false"
                         Text='<%# Eval("Title") %>'></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
               
                <asp:TemplateField HeaderText="附件">
                    <ItemTemplate>
                       <asp:HyperLink ID="lnkAttachment1" Target="_blank"  runat="server"  Text='<%# Eval("Attachment").ToString().Equals("")? "无":Eval("Attachment").ToString().Substring(24) %>' NavigateUrl='<%# Eval("Attachment")%>'/>
                        <telerik:RadAsyncUpload ID="radAttachment" runat="server"   Visible="false" MaxFileInputsCount="1" ToolTip="文件最大不可超过5MB"
                                            TargetFolder="~/Temporary/uploads/com" AllowedFileExtensions=".rar,.txt,.zip,.doc,.pdf,.docx,.ppt,.xls"
                                            MaxFileSize="5120000" ReadOnlyFileInputs="true" ControlObjectsVisibility="None"
                                            Culture="zh-CN">
                                            <Localization Select="浏览" />
                        </telerik:RadAsyncUpload> 
                        <asp:HyperLink ID="lnkAttachment" Target="_blank" Visible="false" runat="server" />
                        <asp:Button ID="btnSubmitAttachment" runat="server" Text="上传"   Visible="false" OnClick="btnSubmitAttachment_Click"/>
                        <asp:Button ID="btnDeleteAttachment" runat="server" Visible="false" Text="删除"  OnClick="btnDeleteAttachment_Click"/>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="邮件内容">
                    <ItemTemplate>
                        <telerik:RadEditor EnableResize="false" Height="280px" ID="RadEditor1" runat="server"
                            Enabled="false" Width="500px" Content='<%# Eval("BodyText") %>'>
                            <Tools>
                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="Bold" />
                                    <telerik:EditorTool Name="Italic" />
                                    <telerik:EditorTool Name="Underline" />
                                </telerik:EditorToolGroup>
                            </Tools>
                            <Modules>
                                <telerik:EditorModule Name="RadEditorStatistics" DockingZone="Bottom" />
                            </Modules>
                        </telerik:RadEditor>
                    </ItemTemplate>
                </asp:TemplateField>
          </Fields>
        </asp:DetailsView>
        <div style="text-align: right; margin-top: 8px; height: 33px; width: 670px;">
           
            <asp:Button ID="Button1"  runat="server"  Text ="回复"  OnClick="Button1_Click"   />
            <asp:Button ID="Button2" runat="server" Text="关闭" OnClientClick="CloseWnd();return false;" />
            
         </div>
</telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

     </form>
</body>
</html>


